<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:body>
    	<ui:composition template="./templates/framework.xhtml">
			<ui:define name="content">
				<ui:include src="./templates/header.xhtml">
					<ui:param name="text" value="#{i18n['resetPassword.head']}" />
				</ui:include>
				<ui:fragment rendered="#{resetPasswordBean.resetRequest != null}">
					<h:form id="resetPasswordForm">
						<input type="hidden" name="id" value="#{resetPasswordBean.resetRequest.exposableId}" />
						<div>
							<h:outputLabel for="password" value="#{i18n['generic.password']}" />
							<h:inputSecret id="password" value="#{resetPasswordBean.password}" required="true" requiredMessage="#{i18n['generic.valueRequired']}" autocomplete="off" redisplay="true" styleClass="switchVisibility" />
							<span class="error"><h:message for="password" /></span>
						</div>
						<div>
							<h:outputLabel value="Strength" for="passwordStrength" />
							<h:outputText id="passwordStrength" value="Unknown" styleClass="outputText" />
						</div>
						<div>
							<h:selectBooleanCheckbox id="passwordChecked" value="#{resetPasswordBean.passwordChecked}" validator="#{genericValidationBean.validatePasswordChecked}" />
							<h:outputLabel for="passwordChecked" styleClass="checkboxLabel"><h:outputText value="#{i18n['generic.passwordChecked']}" /></h:outputLabel>
							<span class="error"><h:message for="passwordChecked" /></span>
						</div>
						<div class="buttons">
							<h:commandButton type="submit" value="#{i18n['resetPassword.change']}" action="#{resetPasswordBean.changePassword}" />
							<input type="button" value="#{i18n['generic.cancel']}" onclick="location.href='login.xhtml'" />
						</div>
					</h:form>
				</ui:fragment>
				<ui:fragment rendered="#{resetPasswordBean.resetRequest == null}">
					<p>
						<h:outputText value="#{i18n['resetPassword.invalidRequest']}" />
					</p>
				</ui:fragment>
			</ui:define>
		</ui:composition>
    </h:body>
</html>